<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/inc/taglib.inc" %>
<%@ include file="/WEB-INF/inc/script.inc" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
	<base href="${base}">
    <title>中金通 | 详情</title>

    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="font-awesome/css/font-awesome.css" rel="stylesheet">

	<!-- Data Tables -->
    <link href="css/plugins/dataTables/dataTables.bootstrap.css" rel="stylesheet">
    <link href="css/plugins/dataTables/dataTables.responsive.css" rel="stylesheet">
    <link href="css/plugins/dataTables/dataTables.tableTools.min.css" rel="stylesheet">

    <link href="css/animate.css" rel="stylesheet">
    <link href="css/style.css" rel="stylesheet">

    <link href="css/plugins/datapicker/datepicker3.css" rel="stylesheet">

</head>

<body>

    <div id="wrapper">

    	<!-- 左侧菜单 -->
        <jsp:include page="/WEB-INF/jsp/common/main-menu.jsp"></jsp:include>

        <div id="page-wrapper" class="gray-bg">
        <div class="row border-bottom">
        <!-- 头部工具栏区 -->
        <jsp:include page="/WEB-INF/jsp/common/main-header.jsp"></jsp:include>
        </div>
            <div class="row wrapper border-bottom white-bg page-heading">
                <div class="col-lg-10">
                    <h2>财务管理</h2>
                    <ol class="breadcrumb">
                        <li>
                            <a href="common/platform">Home</a>
                        </li>
                        <li>
                            <a href="paySerial/list">财务管理</a>
                        </li>
                        <!-- <li>
                         <a href="paySerial/list">财务流水</a>
                        </li> -->
                        <li class="active">
                            <strong>详情</strong>
                        </li>
                    </ol>
                </div>
                <div class="col-lg-2">

                </div>
            </div>
		
		<div class="row" style="margin-top:10px;">
			<div class="col-md-12">
                    <div class="tabs-container">
                        <ul class="nav nav-tabs">
                            <li>
								<a href="paySerial/list">
									财务流水
								</a>
							</li>
							<li class="active">
								<a>
									 详情
								</a>
							</li>
                        </ul>
                        <div class="tab-content">
                            <div class="tab-pane active">
                                <div class="panel-body">
                               <div class="wrapper wrapper-content animated fadeInRight ecommerce">
						                        <div><!-- class="ibox-content" -->
						                            <form method="post" id="addForm" enctype="multipart/form-data"  class="form-horizontal"><!-- action="employee/doAdd" -->
						                              <input type="text" id="paySerialId" name="id" style="display:none" value="${paySerialResBean.id}">
						                              
						                              <!--Detail form start-->
						                              <div class="row">
									                    <div class="col-sm-6">
									                        <div class="form-group">
									                            <label class="col-sm-4 control-label">订单编号</label>
						                                        <div class="col-sm-8">
						                                    	   <input readonly style="border:0px;background:#0f0;background-color:transparent;"  type="text" name="orderId" class="form-control" value="${paySerialResBean.orderId}">
						                                        </div>
									                        </div>
									                    </div> 
									                 </div>
						                             <!-- <div class="hr-line-dashed"></div> -->
						                             <div class="row">
									                    <div class="col-sm-6">
									                        <div class="form-group">
									                            <label class="col-sm-4 control-label">银联流水号</label>
						                                        <div class="col-sm-8">
						                                    	   <input readonly style="border:0px;background:#0f0;background-color:transparent;"  type="text" name="paySerial" class="form-control" value="${paySerialResBean.paySerial}">
						                                        </div>
									                        </div>
									                    </div> 
									                 </div>
						                             <!-- <div class="hr-line-dashed"></div> -->
						                              <div class="row">
									                    <div class="col-sm-6">
									                        <div class="form-group">
									                            <label class="col-sm-4 control-label">投资人</label>
						                                        <div class="col-sm-8">
						                                    	   <input readonly style="border:0px;background:#0f0;background-color:transparent;"  type="text" name="investorName" class="form-control" value="${paySerialResBean.investorName}">
						                                        </div>
									                        </div>
									                    </div> 
									                 </div>
									                  <!-- <div class="hr-line-dashed"></div> -->
						                              <div class="row">
									                    <div class="col-sm-6">
									                        <div class="form-group">
									                            <label class="col-sm-4 control-label">身份证</label>
						                                        <div class="col-sm-8">
						                                    	   <input readonly style="border:0px;background:#0f0;background-color:transparent;"  type="text" name="idcard" class="form-control" value="${paySerialResBean.idcard}">
						                                        </div>
									                        </div>
									                    </div> 
									                 </div>
									                 <!-- <div class="hr-line-dashed"></div> -->
						                              <div class="row">
									                    <div class="col-sm-6">
									                        <div class="form-group">
									                            <label class="col-sm-4 control-label">开户行</label>
						                                        <div class="col-sm-8">
						                                    	   <input readonly style="border:0px;background:#0f0;background-color:transparent;"  type="text" name="bankDeposit" class="form-control" value="${paySerialResBean.bankDeposit}">
						                                        </div>
									                        </div>
									                    </div> 
									                 </div>
									                 <!-- <div class="hr-line-dashed"></div> -->
						                              <div class="row">
									                    <div class="col-sm-6">
									                        <div class="form-group">
									                            <label class="col-sm-4 control-label">卡号</label>
						                                        <div class="col-sm-8">
						                                    	   <input readonly style="border:0px;background:#0f0;background-color:transparent;"  type="text" name="bankAccount" class="form-control" value="${paySerialResBean.bankAccount}">
						                                        </div>
									                        </div>
									                    </div> 
									                 </div>
									                  <!-- <div class="hr-line-dashed"></div> -->
						                              <div class="row">
									                    <div class="col-sm-6">
									                        <div class="form-group">
									                            <label class="col-sm-4 control-label">产品</label>
						                                        <div class="col-sm-8">
						                                    	   <input readonly style="border:0px;background:#0f0;background-color:transparent;"  type="text" name="productBriefName" class="form-control" value="${paySerialResBean.productBriefName}">
						                                        </div>
									                        </div>
									                    </div> 
									                 </div>
						                             <!-- <div class="hr-line-dashed"></div> -->
						                             <div class="row">
									                    <div class="col-sm-6">
									                        <div class="form-group">
									                            <label class="col-sm-4 control-label">订单金额</label>
						                                        <div class="col-sm-8">
						                                    	   <input readonly style="border:0px;background:#0f0;background-color:transparent;" type="text" name="orderAmount" class="form-control"  value='<fmt:formatNumber value="${paySerialResBean.orderAmount}" pattern="##,###,###,###,##0.00 元"/>'>
						                                        </div>
									                        </div>
									                    </div>
									                 </div>
						                            <!--  <div class="hr-line-dashed"></div> -->
						                              <div class="row">
									                    <div class="col-sm-6">
									                        <div class="form-group">
									                            <label class="col-sm-4 control-label">下单时间</label>
						                                        <div class="col-sm-8">
						                                    	   <input readonly style="border:0px;background:#0f0;background-color:transparent;" id="orderTime" type="text" name="orderTime" class="form-control"  value='<fmt:formatDate value="${paySerialResBean.orderTime}" pattern="yyyy-MM-dd HH:mm:ss"/>'>
						                                        </div>
									                        </div>
									                    </div>
									                 </div>
									                  <!-- <div class="hr-line-dashed"></div> -->
						                             <div class="row">
									                    <div class="col-sm-6">
									                        <div class="form-group">
									                            <label class="col-sm-4 control-label">支付金额</label>
						                                        <div class="col-sm-8">
						                                    	   <input readonly style="border:0px;background:#0f0;background-color:transparent;" type="text" name="payAmount" class="form-control"  value='<fmt:formatNumber value="${paySerialResBean.payAmount}" pattern="##,###,###,###,##0.00 元"/>'>
						                                        </div>
									                        </div>
									                    </div>
									                 </div>
									                  <!--  <div class="hr-line-dashed"></div> -->
						                              <div class="row">
									                    <div class="col-sm-6">
									                        <div class="form-group">
									                            <label class="col-sm-4 control-label">支付时间</label>
						                                        <div class="col-sm-8">
						                                    	   <input readonly style="border:0px;background:#0f0;background-color:transparent;" id="payTime" type="text" name="payTime" class="form-control"  value='<fmt:formatDate value="${paySerialResBean.payTime}" pattern="yyyy-MM-dd HH:mm:ss"/>'>
						                                        </div>
									                        </div>
									                    </div>
									                 </div>
						                             <!-- <div class="hr-line-dashed"></div> -->
						                             <div class="row">
									                    <div class="col-sm-6">
									                        <div class="form-group">
									                            <label class="col-sm-4 control-label">审核状态</label>
						                                        <div class="col-sm-8">
						                                           <input readonly style="border:0px;background:#0f0;background-color:transparent;" type="text" id="auditState" class="form-control" value="${paySerialResBean.auditState==0||paySerialResBean.auditState==null?'未审核':'已到账'}">
						                                    	   <!-- <select disabled="disabled" style="border:0px;background:#0f0;background-color:transparent;" id="select_auditState" class="form-control m-b" name="auditState" >
										                              <option value="0">未审核</option>
										                              <option value="1">已到账</option>
										                           </select>   -->
						                                        </div>
									                        </div>
									                    </div>
									                 </div>
						                             <!-- <div class="hr-line-dashed"></div> -->
						                              <div class="row">
									                    <div class="col-sm-6">
									                        <div class="form-group">
									                            <label class="col-sm-4 control-label">审核人</label>
						                                        <div class="col-sm-8">
						                                    	   <input readonly style="border:0px;background:#0f0;background-color:transparent;"  type="text" name="auditName" class="form-control" value="${paySerialResBean.auditName==null?'--':paySerialResBean.auditName}">
						                                        </div>
									                        </div>
									                    </div>
									                 </div>
									                  <!--  <div class="hr-line-dashed"></div> -->
						                              <div class="row">
									                    <div class="col-sm-6">
									                        <div class="form-group">
									                            <label class="col-sm-4 control-label">审核时间</label>
						                                        <div class="col-sm-8">
						                                    	   <input readonly style="border:0px;background:#0f0;background-color:transparent;" id="auditTime" type="text" name="auditTime" class="form-control"  value='<fmt:formatDate value="${paySerialResBean.auditTime}" pattern="yyyy-MM-dd HH:mm:ss"/>'>
						                                        </div>
									                        </div>
									                    </div>
									                 </div>
						                             <!-- <div class="hr-line-dashed"></div> -->
						                             <!-- <div class="hr-line-dashed"></div> -->
						                                 <div class="form-group" id="audit_bttn_div">
						                                    <div class="col-sm-4 col-sm-offset-5">
						                                        <button  class="btn btn-outline btn-primary" type="button" onclick='audit_confirm()'>确认已到账</button>
						                                        <!-- <button class="btn btn-white" type="reset">取 消</button> -->
						                                    </div>
						                                </div> 
						                           </form>
						                        </div>
						                    </div>
                                		</div>
                            		</div>
                        		</div>
                    		</div>
                		</div>
					</div>
		
        <!-- 底部版权 -->
        <jsp:include page="/WEB-INF/jsp/common/main-footer.jsp"></jsp:include>

        </div>
        </div>

    <!-- Mainly scripts -->
    <script src="js/jquery-2.1.1.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/plugins/metisMenu/jquery.metisMenu.js"></script>
    <script src="js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
	<script src="js/jquery.serialize-object.min.js" type="text/javascript"></script>
	<script src="js/plugins/validate/jquery.validate.min.js" type="text/javascript"></script>
    <!-- Custom and plugin javascript -->
    <script src="js/inspinia.js"></script>
    <script src="js/plugins/pace/pace.min.js"></script>
	<script src="js/plugins/bootbox/bootbox.min.js" type="text/javascript"></script>
    <!-- Data picker -->
    <script src="js/plugins/datapicker/bootstrap-datepicker.js"></script>

    <!-- Data Tables -->
    <script src="js/plugins/dataTables/jquery.dataTables.min.js"></script>
    <script src="js/plugins/dataTables/dataTables.bootstrap.js"></script>
    <script src="js/plugins/dataTables/dataTables.responsive.js"></script>
    <script src="js/plugins/dataTables/dataTables.tableTools.min.js"></script>
    
    <!-- 业务 -->
    <script src="js/ajaxfileupload.js?v=${jsVersion}"></script>
   <!--  <script src="js/product/product-grade-module.js"></script> -->
    <script src="js/product/FormatUtils.js?v=${jsVersion}"></script>

    <!-- Page-Level Scripts -->
    <script>
        $(document).ready(function() {
        	/* ProductGradeModule.init(); */
			
			initSpecifiedContent();
        });
        
        function initSpecifiedContent(){
        	if("${paySerialResBean.auditState}"==1){
        		$("#audit_bttn_div").css("display","none");
        	}else if("${paySerialResBean.auditState}"==0){
        		$("#audit_bttn_div").css("display","");
        	}
        	
        	if("${paySerialResBean.auditTime}"==""){
 				$("#auditTime").val("--");
 			}
        }
        
        function audit_confirm(){
        	bootbox.confirm("您确认已到账吗?", function(result) {
                if (result) {
                	audit();
                }
        	});
        }
        
        function audit(){
        	$.ajax({
            	type:"get",
                url: ctx + "/paySerial/audit/${paySerialResBean.id}",
                dataType:"json",
                success: function(data){
                	if (data.code == 1) {
                		bootbox.dialog({
        					message : "审核成功！",
        					//title : "温馨提示：",
        					buttons : {
        						main : {
        							label : "确定",
        							className : "btn btn-outline btn-primary",
        							callback : function() {
        									window.location.reload();
        							}
        						}
        					}
        				});
                	}else{
                		bootbox.alert("审核失败！");
                	}
                },
                error: function (msg) {
                	bootbox.alert(msg.message);
                }
            });
        }
    </script>

</body>
</html>